package com.ruoyi.web.controller.system;

import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.Orderr;
import com.ruoyi.system.service.IOrderrService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 测试Controller
 * 
 * @author ruoyi
 * @date 2024-12-11
 */
@RestController
@RequestMapping("/system/orderr")
public class OrderrController extends BaseController
{
    @Autowired
    private IOrderrService orderrService;

    /**
     * 查询测试列表
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:list')")
    @GetMapping("/list")
    public TableDataInfo list(Orderr orderr)
    {
        startPage();
        List<Orderr> list = orderrService.selectOrderrList(orderr);
        return getDataTable(list);
    }

    /**
     * 导出测试列表
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:export')")
    @Log(title = "测试", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Orderr orderr)
    {
        List<Orderr> list = orderrService.selectOrderrList(orderr);
        ExcelUtil<Orderr> util = new ExcelUtil<Orderr>(Orderr.class);
        util.exportExcel(response, list, "测试数据");
    }

    /**
     * 获取测试详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:query')")
    @GetMapping(value = "/{recordId}")
    public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
    {
        return success(orderrService.selectOrderrByRecordId(recordId));
    }

    /**
     * 新增测试
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:add')")
    @Log(title = "测试", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Orderr orderr)
    {
        return toAjax(orderrService.insertOrderr(orderr));
    }

    /**
     * 修改测试
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:edit')")
    @Log(title = "测试", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Orderr orderr)
    {
        return toAjax(orderrService.updateOrderr(orderr));
    }

    /**
     * 删除测试
     */
    @PreAuthorize("@ss.hasPermi('system:orderr:remove')")
    @Log(title = "测试", businessType = BusinessType.DELETE)
	@DeleteMapping("/{recordIds}")
    public AjaxResult remove(@PathVariable Long[] recordIds)
    {
        return toAjax(orderrService.deleteOrderrByRecordIds(recordIds));
    }

    @GetMapping("/tongji")
    public Map zongshu(String recordTime){
        return orderrService.countOrderrTime(recordTime);
    }

    @GetMapping("/source")
    public List<Map> source(String recordDate){
        return orderrService.countOrderrSource(recordDate);
    }

    @GetMapping("/property")
    public List<Map> property(String recordDate1){
        return orderrService.countOrderrSource1(recordDate1);
    }

    @GetMapping("orde")
    public List<Map> orde(){
        return orderrService.countOrderr();
    }
    @GetMapping("/tomorrow")
    public List<Map> tomorrow(){
        return orderrService.tomorrow();
    }

    @GetMapping("/viptype")
    public List<Map> viptype(){
        return orderrService.viptype();
    }

    @GetMapping("/ynmoney")
    public int ynMoney(){
        return orderrService.ynMoney();
    }

    @GetMapping("/ordesourceT")
    public List<Map> ordesourceT(){
        return orderrService.ordesourceT();
    }

    @GetMapping("/ordestatus2")
    public int ordestatus2(){
        return orderrService.ordestatus2();
    }

    @GetMapping("/ordestatusall")
    public int ordestatusall(){
        return orderrService.ordestatusall();
    }

    @GetMapping("/endtime")
    public int endtime(){
        return orderrService.endTIme();
    }

    @GetMapping("/tousu")
    public int tousu(){
        return orderrService.tousu();
    }
}
